﻿

<!--********************* Part1:Jsp Head *********************-->

<%@ page contentType="text/html;charset=UTF-8"%>  
<%@ include file="/framework/head.jsp"%>

<!--********************* Part2:Java Code *********************-->
<%
    CustomerStaffSearchEventEx event = (CustomerStaffSearchEventEx)context.getSessionValue("CustomerStaffSearchEvent");
	ObjectList list = CustomerStaff.fetch().search(con,event);
%>

<!--********************* Part3:JavaScript Code ***************-->
<!--start 客户端脚本区域-->
<script language=javascript><!--

var list_code = "listCustomerStaff";

function doSearch()
{
    SetValue("s_CustomerCode",GetValue("i_CustomerCode")); //所属客户编码
    
	SetValue("s_Code",GetValue("i_Code")); //工号

	SetValue("s_SelfCode",GetValue("i_SelfCode")); //自编码

	SetValue("s_Name",GetValue("i_Name")); //姓名

	SetValue("s_IsDraw",GetValue("i_IsDraw")); //是否可领料
    
	SetValue("s_Status",GetValue("i_Status")); //是否有效

	SetValue("s_OrderField",GetValue("i_OrderField")); //排序
	SetValue("s_OrderDesc",getCheckBoxValues("i_OrderDesc")); //升降序
	doCommonSearch();
}

function bizViewCustomerStaff(id)
{
	viewWin("<%=Config.getSrv()%>?action_code=viewCustomerStaff&Id="+id);
}

function doDelete()
{
	if(!hasChooseRadio("ids"))
	{
		bizMessage("删除","客户员工");
		return false;
	}
	if(!bizConfirm("删除","客户员工")) return false;
	SetAction("deleteCustomerStaff");
	frm.submit();
}

function doToAdd()
{
	SetAction("toAddCustomerStaff");
	frm.submit();
}

function doToUpdate()
{
	if(!checkOne("ids")) 
	{
		bizMessage("修改","客户员工");
		return false;
	}
	SetValue("Id",getCheckBoxValue("ids"));
	SetAction("toUpdateCustomerStaff");
	frm.submit();
}
function doToCopy()
{
	if(!checkOne("ids")) 
	{
		bizMessage("复制","客户员工");
		return false;
	}
	SetValue("Id",getCheckBoxValue("ids"));
	SetAction("toCopyCustomerStaff");
	frm.submit();
}
function doBackCustomer()
{
    SetAction("listCustomer");
    frm.submit();
}

key_InitDefault();
key_RegSubmitHandler(doSearch);
--></script>


<%=uiBody%>>

<%@ include file="/framework/menu.jsp"%>

<!--********************* Part4:Form  ***************-->
<form id=frm action="<%=Config.getSrv()%>" method="post">
<input type=hidden name="action_code" value="">
<input type=hidden name="Id" value="">
<input type=hidden name=sortOrder value="1">

<!--查询条件保留区域-->
<input type=hidden name="s_CustomerCode" value="<%=event.getCustomerCode()%>"> <!--工号-->

<input type=hidden name="s_Code" value="<%=event.getCode()%>"> <!--工号-->

<input type=hidden name="s_SelfCode" value="<%=event.getSelfCode()%>"> <!--自编码-->

<input type=hidden name="s_Name" value="<%=event.getName()%>"> <!--姓名-->

<input type=hidden name="s_IsDraw" value="<%=event.getIsDraw()%>"> <!--是否可临料-->

<input type=hidden name="s_Status" value="<%=event.getStatus()%>"> <!--是否可临料-->

<%@ include file="/framework/list_head.jsp"%>

<br>
<!--********************* Part5:Search Area ***************-->
<%=uiSearchStart%>>
<%
	int key_tab = 1 ;
%>

	<%=uiSearchInputTR%>>
		<%=uiSearchInputTDHead%>>
			所&nbsp;属&nbsp;客&nbsp;户：
		    <%=event.getCustomer_Name() %>
		    <input type="hidden" class="texts" name="i_CustomerCode" size="20" value="<%=event.getCustomerCode()%>" key_tab="<%=key_tab++%>">
        </td>		
	</tr>

	<%=uiSearchInputTR%>>
		<%=uiSearchInputTDHead%>>
			工&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;号：
			<input type="text" class="texts" name="i_Code" size="20" value="<%=event.viewCode()%>" key_tab="<%=key_tab++%>">

			自&nbsp;&nbsp;编&nbsp;&nbsp;码：
			<input type="text" class="texts" name="i_SelfCode" size="20" value="<%=event.viewSelfCode()%>" key_tab="<%=key_tab++%>">
	
			姓&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;名：
			<input type="text" class="texts" name="i_Name" size="20" value="<%=event.viewName()%>" key_tab="<%=key_tab++%>">
		</td>		
	</tr>

	<%=uiSearchInputTR%>>
		<%=uiSearchInputTDHead%>>
			是否可领料：
			<%=SelectManager.viewYesOrNoSelect("i_IsDraw",event.viewStatus(),true,"",SelectManager.SELECT_ALL,"","key_tab="+(key_tab++))%>
	
             有&nbsp;&nbsp;效&nbsp;&nbsp;性：
            <%=SelectManager.viewValidOrNoSelect("i_Status",event.viewStatus(),true,"",SelectManager.SELECT_ALL,"","key_tab="+(key_tab++))%>
        </td>       
    </tr>

	<%=uiSearchInputTR%>>
		<%=uiSearchInputTDHead%>>
			按&nbsp;&nbsp;排&nbsp;&nbsp;序：
			
			<select name="i_OrderField">
				<option value="" <%=(event.getOrderField().equals("1"))?"selected":""%>>设置排序字段</option>
				
				<option value="CODE" <%=(event.getOrderField().equals("CODE"))?"selected":""%>>工号</option>
				
				<option value="SELF_CODE" <%=(event.getOrderField().equals("SELF_CODE"))?"selected":""%>>自编码</option>
				
				<option value="NAME" <%=(event.getOrderField().equals("NAME"))?"selected":""%>>姓名</option>
				
				<option value="IS_DRAW" <%=(event.getOrderField().equals("IS_DRAW"))?"selected":""%>>是否可领料</option>
				
				<option value="STATUS" <%=(event.getOrderField().equals("STATUS"))?"selected":""%>>有效性</option>
				
			</select>
			&nbsp;&nbsp;
			<input type="radio" name="i_OrderDesc" value="false" <%=(event.isOrderDesc()==false)?"checked":""%> >升序
			<input type="radio" name="i_OrderDesc" value="true"  <%=(event.isOrderDesc()==true)?"checked":""%>  >降序
			<input type="button" value="查询" class="buttons" onclick="doSearch();return false;">&nbsp;<input type="button" value="清空" class="buttons" onclick="doClearEvent();return false;">
		</td>
	</tr>

<%=uiSearchEnd%>

<!--列表标题-->
<%=UIManager.addListHeadTitle("客户员工列表")%>

<!--********************* Part6:List Area ***************-->

<%=uiListStart%>>

<%@ include file="/framework/list_foot.jsp"%>

<%
	int index = 1 ;
%>	
	<%=uiListHeadTR%>>
		<%=UIManager.addListHeadCheckBox() %>

		<%=UIManager.addListHead("工号",index++)%>

		<%=UIManager.addListHead("自编码",index++)%>

		<%=UIManager.addListHead("姓名",index++)%>

		<%=UIManager.addListHead("是否可领料",index++)%>

		<%=UIManager.addListHead("有效性",index++)%>
     
		<%=UIManager.addListHead("操作",-1)%>  
	<%=uiListHeadTREnd%>>
	
	<!--data-->
<%
	for(int i=0;i<list.size();i++)
	{
		CustomerStaff obj = (CustomerStaff)list.get(i);
%>
	<%=uiListDataTR[i%2]%> align=center>
    	<%=uiListDataTD%>>
    		<input type="checkbox" name="ids" value="<%=obj.getId()%>">
    	</td>
    
    	<%=uiListDataTD%>><%=obj.viewCode(con)%></td>
    
    	<%=uiListDataTD%>><%=obj.viewSelfCode(con)%></td>
    
    	<%=uiListDataTD%>><%=obj.viewName(con)%></td>
    
    	<%=uiListDataTD%>><%=obj.viewIsDraw(con)%></td>
    
    	<%=uiListDataTD%>><%=obj.viewStatus(con)%></td>

    	<%=uiListDataTD%>>
    		<a href="" onclick="bizViewCustomerStaff('<%=obj.getId()%>');return false;">浏览</a>
    	</td>
  	</tr>
<%	
	}
%>  

<%@ include file="/framework/list_foot2.jsp"%>

<%=uiListEnd%>


<!--********************* Part7:Action Area ***************-->
<%=uiCommandStart%>>
	<%=uiCommandTR%>>
		<%=uiCommandTD%>>
		<input type=button value="   添加   " class="buttons" onclick="doToAdd();return false;">
		<!--
		<input type=button value="   复制   " class="buttons" onclick="doToCopy();return false;">
		-->
		<input type=button value="   修改   " class="buttons" onclick="doToUpdate();return false;">
		<!--  <input type=button value="   删除   " class="buttons" onclick="doDelete();return false;">-->
        <input type=button value="   返回   " class="buttons" onclick="doBackCustomer();return false;">
		</td>
	</tr>	
<%=uiCommandEnd%>
</form>


<%@ include file="/framework/foot.jsp"%>

<!--
	Author    :Wing
	FileName  :/system/base/CustomerStaffList.jsp
-->
